#!/bin/bash
X=45;Y=21; expr $X-$Y
echo $[X-Y]
echo $[45+21]
echo $[40*20]

let X++; echo $X
let Y--; echo $Y
let X+=2; echo $X

echo $RANDOM
echo $RANDOM

echo $[RANDOM%100]
echo $[RANDOM%100]

seq 3
seq 3 5
seq 3 2 15

echo "45.67-21.03"|bc
echo "scale=5;10/3"|bc

Var="/etc/httpd/conf/httpd.cof"
dirname $Var
basename $Var

Var1=BeiDaQingNiao
expr substr $Var1 4 6

Var2=BeiDaQingNiao
echo ${Var2:4:6}

Var3=BeiDaQingNiao
echo ${Var3/i/##}
echo ${Var3//i/##}

#head -1 /dev/urandom
head -1 /dev/urandom | md5sum

head -1 /dev/urandom | md5sum | cut -b -8
head -1 /dev/urandom | md5sum | cut -b -9

ls -dl /etc/grub /boot/grup
[-e "/etc/grup"] && echo YES
[-e "/boot/grup"] && echo YES
